package ms.maplestory.boot.world.field.objects.npc;

import lombok.Getter;
import lombok.Setter;
import ms.maplestory.boot.world.field.objects.FieldObj;

import java.util.HashMap;
import java.util.Map;

@Getter
@Setter
public class Npc extends FieldObj {

    private boolean move;
    private int trunkGet;
    private int trunkPut;

    private Map<Integer, String> scripts = new HashMap<>();

    public Npc(int id) {
        super(id);
    }

    @Override
    public Npc deepCopy() {
        Npc copy = new Npc(getId());
        copy.setType(getType());
        copy.setX(getX());
        copy.setY(getY());
        copy.setMobTime(getMobTime());
        copy.setHide(isHide());
        copy.setFh(getFh());
        copy.setCy(getCy());
        copy.setRx0(getRx0());
        copy.setRx1(getRx1());
        copy.setMove(isMove());
        copy.setTrunkGet(getTrunkGet());
        copy.setTrunkPut(getTrunkPut());
        copy.getScripts().putAll(getScripts());
        return copy;
    }

    @Override
    public String toString() {
        return String.format("ID: %d, ObjectID: %d, Position:" + getPosition(), getId(), getObjectId());
    }
}
